home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 11,000 to 11,999 / 11000.zip / AOLDLs / Web-Publishing / Java fuer Windows 95 / JAVA.lzh / JAVA / JAVA.ZIP / HREFiButtonApplet.java < prev    next >
Encoding:
Java Source  |  1996-06-23  |  1.5 KB  |  49 lines

  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4. /**
  5.  * An applet that demonstrates HREFiButton.
  6.  * Requires HREFiButton.class
  7.  *
  8.  * @author L. Todd Lowe, ltlowe@achilles.net
  9.  * Last change:  LTL  23 Jun 96   12:10 pm
  10.  */
  11. public class HREFiButtonApplet extends Applet
  12. {
  13.     HREFiButton b;
  14.  
  15.     /**
  16.      * Initialise the applet.  Get the parameters and pass
  17.      * them to HREFiButton().
  18.      *
  19.      * @param href   The URL to be loaded when the button is pressed. (From <Applet> tag.)
  20.      * @param frame  The frame in which to display the URL (optional). (From <Applet> tag.)
  21.      * @param upImage The image to be displayed when the button is up. (From <Applet> tag.)
  22.      * @param downImage The image to be displayed when the button is pressed.  (From <Applet> tag.)
  23.      */
  24.     public void init() 
  25.     {
  26.         setLayout( new GridLayout(1,1) ); 
  27.         b = new HREFiButton( this,
  28.                               getParameter("href"),
  29.                               getParameter("frame"),
  30.                               getParameter("label"),
  31.                               getParameter("upImage"),
  32.                               getParameter("downImage")   );
  33.         add(b);
  34.     }
  35.  
  36.     /**
  37.      * mouseEnter() is needed at the Applet level to
  38.      * prevent Netscape from displaying "Applet is running"
  39.      * every time the mouse moves over the applet.
  40.      * Without this patch/kludge the status updates of the
  41.      * HREFiButton are often overwritten and obscured! 
  42.      */
  43.     public boolean mouseEnter(Event e, int x, int y )
  44.     {
  45.         return true;
  46.     }
  47. }
  48.  
  49.